package Ch7;

public class SumMachine1 {

	 public int makeSum(int startValue, int endValue){
		 int start = startValue;
		 int end = endValue;
		 int sum = 0;
		 
		 for(int i = start; i <= end; i++){
			 sum = sum + i;
		 }//end for
		 return sum;
	 }
	 
	 public static void main(String[] args) {
		SumMachine1 m = new SumMachine1();
		int result1 = m. makeSum(1,100);
		int result2 = m. makeSum(2,200);
		int result3 = m. makeSum(3,300);
		
		System.out.println(result1);
		System.out.println(result2);
		System.out.println(result3);
	}
}
